package com.example.demo.controller;

import com.example.demo.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 报警
 * @author chensixiang chensixiang1234@gmail.com
 */
@Slf4j
@Component
public class WarningConsumer {

    @RabbitListener(queues = ConfirmConfig.WARNING_QUEUE_NAME)
    public void warning(Message message) {
        String msg = new String(message.getBody());
        log.info("报警发现不可路由消息，消息为->" + msg);
    }
}
